Skip to main content

Creating a custom Block

To create a Block in Sketchware Pro, you need to know some terms related to Blocks.

Create a Block in Sketchware Pro

Step 1: Go to Sketchware Pro and click on 3 dots.

Open menu

Step 2: Go to developer tools.

Developer Tools

Step 3: Select Block manager.

Block manager

Step 4: Click on Add icon.

Add block

Step 5: Enter a name for the palette name as you want and select a color by clicking on the color icon and then clicking on save.

Creating palette

Step 6: Here at the bottom a palette has been created successfully just click it and it will open a new screen.

Palette Created

Step 7: Click on add icon.

Add

Step 8: Fill in the fields as your need and click on Save.

block_fields

Properties

FieldExplanationRequired
NameThis is a unique name for your Block. Sketchware Pro uses this to identify different Blocks. The name should not be the same as other blocks.Yes
TypePlease enter value according to your block code(Eg. Void,If-then,If-else etc).Yes
Type NameRead Type NameIf Type is c then this field is required.

Name

This is a unique name for a block in Sketchware Pro. It functions as the ID of the block. When you use a Block in a project, Sketchware Pro uses this property to identify each block and its associated code. The name should not be the same as other blocks to prevent potential errors.

Type

Study the data below:

  • regular

type-regular

  • c (if block)

type-c

  • e (if-else block)

type-e

  • s (String)

block-type-shape

  • b (Boolean)

type-b

  • d (Number)

type-d

  • v (Variable)

block-type-shape

  • a (Map)

block-type-shape

  • f (stop block)

type-f

  • l (List)

block-type-shape

  • p (Component)

block-type-shape

Type Name

This field is required only if the Type Name is "p". It indicates that the block is related to a component defined in the Type Name property.

Design

FieldExplanationRequired
ColorThis field determines the color of your block.Yes
Block SpecThis property is used to design your block.Yes

Color

The color property allows you to set the desired color for your block, enabling customization and enhancing its visual appearance.

Block Spec

The Block Spec is a versatile tool that helps you design and structure block content. It supports various data types such as text, strings, code, numbers, booleans, and more. This empowers you to create customized blocks tailored to your specific requirements. Additionally, you can effortlessly add additional properties to expand the capabilities of the Block Spec, aligning it perfectly with your unique needs.